$(() => {
    const token = GetQueryString("token");

    $.ajax({
        type: "post",
        url: url,
        data: { 'method': 'Api|apply_company' },
        dataType: 'json',
        success: function(res) {
            // console.log(res);
            if (res.status == 1) {
                let data = res.data;
                let html = '';
                data.phone.forEach(item => {
                    html += `
                        <p>客服热线：<a style="color:rgb(51,51,51);" href="tel:${item}" class="sendMsg">${item}</a></p>
                    `;
                });
                $('.shopTel').html(html);
            }
        }
    })

    $(document).on('click', '.sendMsg', function() {
        let phone = $(this).html();
        // console.log(phone);
        $.ajax({
            type: "post",
            url: url,
            data: { 'method': 'Api|call_msg_send', 'token': token, "phone": phone },
            dataType: 'json',
            success: function(res) {
                if (res.status == 1) {
                    // alert(res.message);
                } else if (res.status == 2) {
                    location.href = "fox://logout";
                } else {
                    alert(res.message);
                }
            }
        })
    })
})